<?php
if ($this->Session->flash()):
?>
	<div class="alert alert-warning">
		<?php  echo $this->Session->flash();?>
	</div>
<?php
endif;
?>

<div class="row">
	<div class="col-lg-12">
		<h2 class="page-header">Edit Product: <?php echo $datas[0]['products']['pro_name'];?></h2>
	</div>
</div>
<?php echo $this->Form->create('products', array('action' => 'edit/'.$datas[0]['products']['pro_id'], 'method' => 'post', 'id'=>'edit', 'type' => 'file')); ?>
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
	<tbody>
		<tr>
			<th width="15%">Tên sản phẩm <span class="require">*</span></th>
			<td>
			<?php
			echo $this->Form->input('pro_name', array(
					'type' => 'text',
					'label' => false,
					'class' => 'input txtbox w400 required',
					'required' => true,
					'id'=>'pro_name',
					'value'=>$datas[0]['products']['pro_name'],
					'placeholder' =>('Tên sản phẩm')
			));
			?>
			</td>
		</tr>
		<tr>
			<th>Giá sản phẩm</th>
			<td>
			<?php
			echo $this->Form->input('pro_price', array(
					'type' => 'text',
					'label' => false,
					'class' => 'input txtbox w200',
					'required' => false,
					'id'=>'pro_price',
					'value'=>$datas[0]['products']['pro_price'],
					'placeholder' =>('Giá sản phẩm')
			));
			?>
			</td>
		</tr>
		<tr>
			<th>Loại sản phẩm</th>
			<td>
			<?php
			$options = array('0' => 'Cũ ', '1' => 'Mới');
			$attributes = array('legend' => false,'value' => $datas[0]['products']['pro_new']);
			echo $this->Form->radio('pro_new', $options, $attributes);
			?>
			</td>
		</tr>
		<tr>
			<th>Ảnh sản phẩm</th>
			<td>
			<?php
			echo $this->Form->file('file][',
				array('type' => 'file',
				'id'=>'file_'.$datas[0]['products']['pro_id'],
				'class'=>'file',
				'subImage'=>$datas[0]['products']['pro_id'],
			));
			?>
			</td>
		</tr>
		<tr>
			<th>Miêu tả</th>
			<td>
			<?php
				echo $this->Form->textarea('pro_teaser', array(
					'label' => false,
					'class' => 'ckeditor',
					'required' => false,
					'rows'=>4,
					'value'=>$datas[0]['products']['pro_teaser']
				));
			?>
			</td>
		</tr>
		<tr>
			<th></th>
			<td>
			<?php
			echo $this->Form->button('Submit',array(
				'type' => 'submit',
				'class' => 'btn btn-primary',
				'label' => FALSE,
				'div' => FALSE
			)) . '  ';

			echo $this->Form->button('Reset', array(
				'type' => 'reset',
				'class' => 'btn btn-primary',
				'label' => false,
				'div' => false,
			));

			?>

			</td>
		</tr>
	</tbody>
</table>
<?php echo $this->Form->end()?>